home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / fortran / ftnchek2.9 / ftnchek2 / usr / local / doc / ftnchek-2.9.0 / README < prev   
Encoding:
Text File  |  1996-04-09  |  21.2 KB  |  468 lines

  1.          README file for Ftnchek Version 2.9.0
  2.  
  3. Author: Robert Moniot
  4.     Fordham University
  5.     New York, NY  10023  USA
  6.     Telephone: (212) 636-6311
  7.     Internet:  moniot@mary.fordham.edu
  8.  
  9. Date:    March 4, 1996
  10.  
  11. Ftnchek is written in a portable style of C.  You must have a C
  12. compiler for the machine on which you wish to build it.
  13. Information about the latest version and the status of the project can be
  14. obtained by the Internet command ``finger ftnchek@mary.fordham.edu''.
  15.  
  16. If the file you received is a UNIX compressed tar file, suffix .Z, you
  17. should first unzip it using the UNIX ``uncompress'' command, and then
  18. give it as input to ``tar'' to unpack the files.  For example, assuming
  19. the file has been placed in the desired directory, and is named
  20. ftnchek.tar.Z, you would give the two UNIX commands
  21.     uncompress ftnchek.tar.Z
  22.     tar -xf ftnchek.tar
  23. If the suffix is .gz instead of .Z, use the program ``gunzip'' in
  24. place of ``uncompress''.  The gunzip program is publicly available
  25. from the GNU project.
  26.  
  27. The tar command creates a directory named ftnchek-2.9.1 containing the
  28. files of the distribution.  These files are described briefly below.
  29. You should change directory to this directory and follow the
  30. installation instructions.
  31.  
  32.  
  33.           INSTALLING FTNCHEK
  34.           ------------------
  35.  
  36. See the file INSTALL for detailed instructions on how to install
  37. ftnchek on your system.  Once Ftnchek is working, you can test it by
  38. giving the command:
  39.  
  40.         $ ftnchek -list -sym average
  41.  
  42. Then compare the output against the file ``average.out''.  A more
  43. thorough checkout is possible on Unix systems by giving the ``make
  44. check'' command described above.
  45.  
  46.  
  47.            NEW FEATURES
  48.            ------------
  49.  
  50. Here are the new features in version 2.9, aside from bug fixes:
  51.  
  52.     o New warnings: statement function defined but not used; and
  53.       common block and subprogram that have the same name.
  54.  
  55.     o The -f77, -portability, -pretty, and -truncation options now
  56.       take lists of keywords to provide finer control over
  57.       warnings.  The -hollerith flag is eliminated: use
  58.       -port=hollerith instead.
  59.  
  60.     o The -backslash and -tab flags are replaced with -source=num
  61.       setting, which also includes control of VMS syntax for
  62.       INCLUDE statement (defaulting extension, /LIST qualifier).
  63.  
  64.     o New setting -intrinsic=num to control treatment of
  65.       nonstandard intrinsic functions.  Ones digit selects which
  66.       set of intrinsic functions to recognize.  Tens digit
  67.       controls RAND syntax and hundreds digit IARGC syntax.  These
  68.       were formerly compilation options when building ftnchek.
  69.  
  70.     o The -usage flag is now a 3-digit number, for separate
  71.       control of checking of subprograms, common variables, and
  72.       local variables.  See the manual for details.
  73.  
  74.     o The -calltree option now takes various numeric settings to
  75.       specify options for the form of the output.
  76.  
  77.     o The -noverbose flag is changed to -quiet.
  78.  
  79.     o New flag -version to print ftnchek's name and version.
  80.  
  81.     o New flag, -nocheck, useful to suppress warnings when using
  82.       ftnchek for purposes other than checking.
  83.  
  84.     o New -makedcls value: 512=no-array-dimensions.  This bit is
  85.       for users who have code lacking type declarations so they
  86.       can insert the dcl files without change into the code.
  87.  
  88.     o Command-line numeric settings can omit the number, giving
  89.       them default turn-on values.
  90.  
  91.     o Ftnchek now reads a startup file named .ftnchekrc or
  92.       ftnchek.ini located in the current directory or in the home
  93.       directory.
  94.  
  95.     o Made the non-parenthesis PARAMETER statement variant part of
  96.       the distribution, i.e. no longer as a patch accompanying the
  97.       source.
  98.  
  99.     o Made the "Cray" POINTER statement part of the distribution,
  100.       i.e. no longer as a patch accompanying the source.
  101.  
  102.     o The support for VCG has been improved so that ftnchek now
  103.       sends VCG output to a file that is suitable for direct input
  104.       to xvcg.  The script fcl2vcg is now obsolete.  Support for
  105.       VCG is now automatic.
  106.  
  107.     o Some improvements to help in maintaining and distributing
  108.       ftnchek: the source code has been augmented with function
  109.       prototypes, and a configure script is used to handle
  110.       variations among systems automatically.  Hopefully some of
  111.       the glitches in installation will be smoothed over by this.
  112.       (Please report any glitches that remain so the configure
  113.       script can be fixed.)
  114.  
  115.                  SOURCE FILES
  116.                  ------------
  117.  
  118. The minimum set of source files needed to compile ftnchek are:
  119.  
  120. Header files:
  121.     ftnchek.h intrins.h iokeywds.h keywords.h
  122.     symtab.h tokdefs.h
  123.  
  124. C source:
  125.     exprtype.c forlex.c fortran.c ftnchek.c
  126.     pgsymtab.c plsymtab.c project.c symtab.c
  127.  
  128. For VAX, there is also required:
  129.     shell_mung.c
  130.  
  131. An associated file, not needed to compile ftnchek, is the Yacc grammar:
  132.     fortran.y
  133. The file fortran.c is generated from fortran.y by yacc or bison.  The
  134. file tokdefs.h is a copy of the y.tab.h file also generated from fortran.y.
  135.  
  136. There is a module definition file for IBM PC-OS/2:
  137.     ftnchek.def 
  138.  
  139.  
  140.            AUXILIARY FILES
  141.            ---------------
  142.  
  143. This section describes the auxiliary and documentation files included
  144. with the distribution.
  145.  
  146. The example program used in the documentation, the result of running
  147. Ftnchek on it, and the example program, corrected:
  148.     average.f average.out correct.f
  149.  
  150. NOTE: VAX/VMS users should rename "AVERAGE.F" to "AVERAGE.FOR".
  151.  
  152. DCL command files for building ftnchek on DEC VAX and Alpha under VMS:
  153.     build.com build-alpha.com cc.com link.com link-alpha.com
  154.  
  155. An awk script which converts declarations files into include files,
  156. and a file used to create a shell script (to be installed as dcl2inc):
  157.     dcl2inc.awk dcl2inc.sh.in
  158.  
  159. Files used to create Makefile:
  160.     configure configure.in Makefile.in
  161.  
  162. Specialized makefiles for Borland C (IBM PC), Macintosh
  163. Programmer's Workbench, OS/2 and UNIX or UNIX-like systems:
  164.     makefile.bc makefile.mpw makefile.os2 makefile.generic makefile.unix
  165.  
  166. The file makefile.generic is created from Makefile.in with vanilla
  167. configuration options.  The file makefile.unix is the former
  168. distribution makefile, with lots of specific targets.  It is no longer
  169. being maintained, but should still work.  Use configure to build a
  170. local Makefile instead.  If you cannot use configure for some reason,
  171. makefile.generic should be OK for most cases, and can be fixed up to
  172. suit your needs.
  173.  
  174. Documentation files:
  175.     ftnchek.doc    ftnchek user's manual in flat text format.
  176.     ftnchek.ps    PostScript version of the same.
  177.     ftnchek.hlp    Source for a HELP library for VMS systems.
  178.     ftnchek.man    The file from which these files are derived.
  179.     dcl2inc.doc    dcl2inc user's manual in flat text format.
  180.     dcl2inc.ps    same in PostScript.
  181.     man2ps        script for converting man pages to PostScript
  182.  
  183. The Unix manual page, ftnchek.1, is generated from ftnchek.man during the
  184. installation process.  The VMS help library, ftnchek.hlb, is generated
  185. from ftnchek.hlp by the build.com script.
  186.  
  187. A list of changes made since the original release of this version:
  188.     PATCHES
  189.  
  190. The UNIX Makefile employs a private script, man2ps, for converting
  191. manual pages to PostScript (linked to names me2ps, mm2ps, and ms2ps,
  192. it will support the -me, -mm, and -ms formats as well).  The script
  193. currently knows about GNU groff, Sun Solaris 2.x troff + dpost and
  194. psroff; it will use any of these, with groff preferred.  For troff +
  195. dpost, if you get errors like this
  196.  
  197. troff: Can't open /usr/lib/font/devpost/C.out; line 818, file <standard input>
  198.  
  199. you can repair them if you have appropriate privileges:
  200.  
  201. % cd /usr/lib/font/devpost
  202. % ln CO C
  203. % ln CO.name C.name
  204. % ln CO.out C.out
  205.  
  206. These commands simply create links between a Courier font that Sun
  207. named CO, and the one named C that is expected by ftnchek.man.  If
  208. some troff expert knows a better way to handle this, please tell us.
  209. Additional alternatives in the man2ps script to support ditroff and
  210. other vendors' troff-to-PostScript solutions will also be welcome.
  211.  
  212.  
  213.  
  214.              CUSTOMIZING
  215.              -----------
  216.  
  217. This section gives details about using macro names to control the
  218. system-dependent choices available in compiling Ftnchek.
  219.  
  220. NOTE: if you choose to alter the definitions of any of these macros
  221. from their default values, then "make check" will probably give some
  222. differences.  You should first build ftnchek using the default
  223. definitions, run "make check" to catch any problems, then rebuild
  224. ftnchek with your preferred definitions before doing "make install".
  225.  
  226. Ftnchek has a number of fixed internal parameters that affect its
  227. operation, such as the symbol table sizes and support for various
  228. extensions and particular operating systems.  The following is a
  229. description of the most important of these parameters.  They are
  230. implemented as C language macro names.  If you wish to change a
  231. parameter defined by one of these macros, it is necessary to recompile
  232. Ftnchek with the macro definition changed to the desired value.
  233.  
  234. Briefly, the effect of the macro names specifying the system is as
  235. follows: If VMS or __TURBOC__ or MSDOS is defined, then both "/" and
  236. "-" are allowed as option prefixes.  Otherwise only "-" is allowed.
  237. If VMS or __TURBOC__ or MSDOS is defined, then ".FOR" will be the
  238. default extension for source files, otherwise ".f" is used.  If VMS is
  239. defined, then support for VMS extensions is enabled by default: this
  240. changes the default values of options -source to 2 (VMS include
  241. syntax) and -intrinsics to 223 (VMS intrinsics set).  If UNIX is
  242. defined, then only "-" is allowed as an option prefix, the default for
  243. -source is 0 and -intrinsics is 222 (UNIX intrinsic set).  More
  244. detailed control over these options is possible by defining other
  245. macro names described below.
  246.  
  247. This can usually be done without editing any of the source files, by
  248. specifying the macro definition on the C compiler command line.  Under
  249. UNIX, this is done with the -D option.  For example, to define the
  250. macro BpW that sets the default word size to be eight bytes, the
  251. compiler would be invoked with the additional option -DBpW=8.  Under
  252. VMS, the corresponding option would be /DEFINE=("BpW=8").  For other
  253. systems, consult your C compiler manual.  When using make, specify
  254. these definitions by setting the macro OPTIONS, e.g.
  255.     make "OPTIONS= -DBpW=8"
  256. If you want to put such definitions into the Makefile, do not edit
  257. Makefile.  Edit Makefile.in and re-run the configure script.
  258.  
  259. Unless otherwise noted, the following macro names need not have any
  260. particular value.  They only need to be defined in order to have
  261. effect.  For more details on these parameters, look at ftnchek.h.
  262. These fall into three broad groups: system-dependent aspects, features
  263. and options, and table sizes.
  264.  
  265.   --- System-dependent defines
  266.  
  267.   Macro                 Meaning                           Remarks
  268. UNIX                  Compile Ftnchek for UNIX-like    Default for most
  269.                        operating system                 choices
  270. VMS                   Compile Ftnchek for VAX/VMS      Automatically defined
  271.                        operating system                 by VAX C compiler
  272. MSDOS                 Compile Ftnchek for MS-DOS       Automatic if compiler
  273.                        operating system                 is Turbo C
  274. NO_PROTOTYPES         Compiler does not accept         Defined by configure
  275.                        ANSI C prototypes
  276. NO_FLOATING_POINT     Suppress floating point          Unimportant--define if
  277.                        computations internally           no hardware f.p.
  278. DEC_TABS              Default value of -source bit 1   Default = 0 (NO)
  279. VMS_INCLUDE           Default value of -source bit 2   Default=0 for Unix,
  280.                                                          1 for VMS
  281. UNIX_BACKSLASH        Default value of -source bit 4   Default = 0 (NO)
  282. OPTION_PREFIX_SLASH   Allow options to start with      Implied by VMS and by
  283.                        either - or /.                   MSDOS
  284. NO_OPTION_PREFIX_SLASH Prohibit options with /         To override VMS or
  285.                              MSDOS default
  286. SPECIAL_HOMEDIR       Home directory for non-unix     VMS default:"SYS$DISK:[]"
  287. UNIX_RC_FILE          Name of startup file.            Default: ".ftnchekrc"
  288. NONUNIX_RC_FILE       Alternate startup filename.      Default: "ftnchek.ini"
  289. DEF_SRC_EXTENSION     Default extension expected       Defaults: VMS, MSDOS:
  290.                        for input source files            ".for" All others: ".f"
  291. DEF_LIST_EXTENSION    Default extension for output     Default: ".lis"
  292.                        list-files
  293. DEF_PROJ_EXTENSION    Default extension for input      Default: ".prj"
  294.                        and output project files
  295. DEF_DCL_EXTENSION     Default extension for            Default: ".dcl"
  296.                        declaration files
  297. DEF_INC_EXTENSION     Default extension for            Default:
  298.                        include files                     DEF_SRC_EXTENSION
  299. DEF_VCG_EXTENSION     Default extension for VCG        Default: ".vcg"
  300.                        output files
  301. STDIN_PROJ_FILENAME   Output project-file name used    Default: "ftnchek.prj"
  302.                        when input source is stdin
  303. ENV_PREFIX            Prefix for environment           Default "FTNCHEK_"
  304.                        variables that set options
  305.  
  306.  
  307.    --- macros that control ftnchek behavior (syntax, options, etc.)
  308. VCG_SUPPORT           Add the -vcg switch to allow     Default: -vcg supported
  309.                        call graph to be visualized.
  310. NO_VCG_SUPPORT        Suppress -vcg support
  311. VCG_GRAPH_OPTIONS     Global vcg graph options.       "color: lightgray\n"
  312. STRICT_SYNTAX         Set default -f77=all             Default is -f77=none
  313. STRICT_PORTABILITY    Set default -port=all            Default is -port=none
  314. UGLY_IS_OK            Set default -pretty=none         Default is -pretty=all
  315. LAX_TRUNCATION        Set default -trunc=none          Default is -trunc=all
  316.  
  317. The following macros control whether ftnchek accepts certain syntax
  318. extensions.  They are all defined and cannot be undefined without
  319. editing ftnchek.h.  If the macros are undefined, then support for the
  320. extension is completely removed.  This means that the corresponding
  321. extension will generate syntax or parse errors, not non-standard
  322. warnings.  Some users might want to do this to make ftnchek smaller
  323. and more efficient, or out of a sense of fanaticism.
  324.  
  325. ALLOW_CRAY_POINTERS    Cray pointer syntax
  326. ALLOW_DOLLARSIGNS    $ in variable names
  327. ALLOW_DO_ENDDO        DO ... ENDDO and related
  328. ALLOW_INCLUDE        INCLUDE statement
  329. ALLOW_QUOTEMARKS    Strings delimited by "
  330. ALLOW_TYPELESS_CONSTANTS  Binary, octal, hex
  331. ALLOW_UNDERSCORES    _ in variable names
  332. ALLOW_UNIX_BACKSLASH    Unix escape sequences in strings
  333. ALLOW_UNIX_CPP        Unix C preprocessor directives
  334. ALLOW_VMS_IO        VMS I/O keywords
  335.  
  336. The following macros determine the default value of the -intrinsic
  337. setting.  The nonstandard double complex intrinsic functions are
  338. always recognized since they are needed by the double complex
  339. datatype.  Other groups of nonstandard functions can be selected to be
  340. recognized by default using these macros.
  341.  
  342. STANDARD_INTRINSICS   Do not recognize extended set
  343.                        of intrinsic functions (Set 0)
  344. NONSTD_INTRINSICS     Support commonly available       Default behavior
  345.                        intrinsic functions (Set 1)
  346. UNIX_INTRINSICS       Support UNIX-specific            Default if UNIX defined
  347.                        intrinsic functions (Set 2)
  348. NO_UNIX_INTRINSICS    Do not support UNIX-specific
  349.                        intrinsic functions
  350. VMS_INTRINSICS        Support VMS-specific             Default if VMS defined
  351.                        intrinsic functions (Set 3)
  352. NO_VMS_INTRINSICS     Do not support VMS-specific
  353.                        intrinsic functions
  354. DEF_INTRINSIC_SET     Specify intrinsic set            Override above defaults
  355.  
  356. RAND_NO_ARG           RAND/IRAND function has no       Default behavior:
  357.                        argument                         allows both 0 argument
  358. RAND_ONE_ARG          RAND/IRAND function has one       and 1 argument forms
  359.                        argument
  360. IARGC_NO_ARG          IARGC has no argument            Default behavior:
  361. IARGC_ONE_ARG         IARGC has 1 argument              both forms allowed
  362.  
  363. NO_BLANKS_IN_NUMBERS  Numeric constants cannot have    Default: blanks allowed
  364.                        embedded blanks.
  365. BLANKS_IN_NUMBERS     Numeric constants may have
  366.                        embedded blanks.
  367. BpW                   Default bytes per word           Default=4
  368.                         (for -wordsize setting) 
  369.  
  370.  
  371.   --- Macros that set table sizes, limits, etc.
  372.  
  373. MAXLINE               Maximum input line length.       Default 132
  374.                         Ignores past this.
  375. MAXIDSIZE             Longest identifier allowed       Default 31
  376. MAX_SRC_TEXT          Longest text string of a token   Default 20*66
  377. MAX_CHAR_CODE         Largest char value               Default 255
  378. MAX_INCLUDE_DEPTH     Max nesting depth of include     Default 16
  379.                        files
  380. MAXEXPRTEXT           Length of expr text saved in     Default 15
  381.                        arg lists
  382. MAX_RC_LINE           Max input line in rc file        Default 500
  383. RC_COMMENT_CHAR       Start of comment in rc file      Default '#'
  384. ENV_INCLUDE_VAR       Name of environment variable     Default "INCLUDE"
  385.                        specifying include directory
  386.  
  387. DEFAULT_INCLUDE_DIR   Name of default include          Defaults:
  388.                        directory                        UNIX: "/usr/include"
  389.                                                         VMS: "SYS$LIBRARY:"
  390.                                                         MSDOS: "\\include"
  391.  
  392.  
  393. The following macros specify various internal table sizes.  If neither
  394. SMALL_MACHINE nor LARGE_MACHINE is defined, intermediate table sizes
  395. will be used.  In any case, individual table sizes can be chosen by
  396. defining the corresponding macro name.  The defaults for the three
  397. size choices (small, default, large) are listed in the Remarks column.
  398.  
  399. SMALL_MACHINE         Table sizes appropriate for a
  400.                        PC without much memory
  401. LARGE_MACHINE         Table sizes appropriate for a
  402.                        mainframe or workstation
  403.  
  404.                                                       small  default large
  405. HASHSZ                Identifier hash table (elements)  798   2002  20930
  406. LOCSYMTABSZ           Local symbol table (entries)      300    800   8000
  407. GLOBSYMTABSZ          Global symbol table (entries)     400   1200  12000
  408.    The following sizes are *chunk sizes*, specifying the initial table
  409.    size and the size of new blocks to allocate when initial amounts
  410.    are used up.  Optimum sizes are dependent on properties of alloc
  411.    function, and do not set limits on total amounts of space.
  412. STRSPACESZ            Identifier string space (bytes)  4000  10000  10000
  413. PARAMINFOSPACESZ      Parameter info field space     20     50    200
  414.             (ParamInfo's)
  415. TOKHEADSPACESZ        Token list header element space    50    200    500
  416.                        (TokenListHeader's)
  417. TOKENSPACESZ          Token list space (tokens). Used   200   1000  10000
  418.                        to store subroutine arguments
  419.                        and other temporary lists.
  420. ARGLISTHEADSZ         Argument list header element      300   1500  15000
  421.                        space (ArgListHeader's)
  422. ARGLISTELTSZ          Argument list element space      1000   5000  50000
  423.                        (ArgListElement's)
  424. COMLISTHEADSZ         Common block list header space    200   1000 10000
  425.                        (ComListHeader's)
  426. COMLISTELTSZ          Common block list element space  1000   4000 50000
  427.                        (ComListElement's)
  428. PTRSPACESZ            Pointers to array dim text and    200    400  2000
  429.                        parameter text (char *'s)
  430. WRAP_COLUMN           Default value for -wrap          Default=79
  431.                       setting.
  432.  
  433.  
  434. For the truly adventurous:
  435.  
  436. Ftnchek has two different memory-management schemes to choose from.
  437. In the default case, space for the hashtable and the local and global
  438. symbol tables is allocated at compile time.  These tables cannot
  439. change size afterwards.  Initial space for strings, tokens (in lists
  440. and trees), token list headers, token source text, pointers to array
  441. dim and parameter text is allocated at compile time.  These areas can
  442. grow as needed by allocating additional chunks that are chained
  443. together in a linked-list arrangement.  Space for argument list
  444. headers and elements, and common list headers and elements starts at
  445. zero and new chunks are allocated as needed.  (None of the newly
  446. allocated chunks are freed, since it is considered likely that the
  447. space will be
  448. needed again.)
  449. This scheme is well
  450. suited to machines with large address spaces and virtual memory.  The
  451. sizes of the fixed tables and chunk sizes for the others can be chosen
  452. in three standard sets: default, SMALL_MACHINE, and LARGE_MACHINE.
  453. The latter is preferred for any virtual-memory machine since memory
  454. does not become "really" allocated until needed.
  455.  
  456. The second memory-management scheme is selected by the compile-time
  457. option DYNAMIC_TABLES.  In this case, the fixed-size arrays for the
  458. hashtable and the local and global symbol tables are replaced by
  459. pointers, and the space they point to is allocated at the start of
  460. program execution.  Everything else is the same.  This version runs
  461. somewhat slower than the first scheme on machines I have tested.  I
  462. have not proceeded to take advantage of the possibility of letting the
  463. table sizes be selected at run time by means of command-line settings.
  464. To do so would require moving the allocation step performed by
  465. init_tables() to just before the start of processing, analogously to
  466. init_typesizes().  It would also need a set of command-line options to
  467. be installed for specifying the different table sizes.
  468.